<template>
  <el-select
      v-model="props.organizationId"
      placeholder="请选择业务组别"
      clearable
      filterable
      :multiple="multiple"
      style="width: 100%"
  >
    <el-option
        v-for="item in groupList"
        :key="item.id"
        :label="item.name"
        :value="item.id"
    />
  </el-select>
</template>
<script setup>
import request from "@/utils/request";

const props = defineProps({
  multiple: {
    type: Boolean,
    default: () => {
      return "";
    },
  },
  organizationId: {
    type: [String, Array],
    default: () => {
      return "";
    },
  },
});

onMounted(() => {
  getInfo();
});
const groupList = ref([]);

async function getInfo() {
  const {data} = await request({
    url: `/system/sysbusinessgroup/getlist`,
    method: "post",
    data: {
      enabled: 1,
    },
  });
  groupList.value = data;
}
</script>
